package com.justech.eat.service.component.impl;

import com.justech.eat.entity.OrderDetail;
import com.justech.eat.repository.OrderRepository;
import com.justech.eat.service.OrderDetailAbnormalService;
import com.justech.eat.service.OrderDetailService;
import com.justech.eat.service.OrderService;
import com.justech.eat.service.component.OrderDetailAfterSettlementProcessor;
import com.justech.eat.service.impl.OrderBookSubmit;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: eat-service
 * @description:
 * @author: feifei.li
 * @create: 2020-06-11 12:26
 **/
public abstract class AbstractOrderDetailAfterSettlementProcessor implements OrderDetailAfterSettlementProcessor {
    @Autowired
    OrderDetailService orderDetailService;
    @Autowired
    OrderService orderService;
    @Autowired
    OrderRepository orderRepository;
    @Autowired
    OrderDetailAbnormalService orderDetailAbnormalService;
    @Autowired
    OrderBookSubmit orderBookSubmit;

    protected Map<Integer, OrderDetail> listToMap(List<OrderDetail> orderDetails) {
        HashMap<Integer, OrderDetail> integerOrderDetailHashMap = new HashMap<>(orderDetails.size());
        for (OrderDetail orderDetail : orderDetails) {
            integerOrderDetailHashMap.put(orderDetail.getType(), orderDetail);
        }
        return integerOrderDetailHashMap;
    }
}
